/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.edu.amu.wmi.kino.visualjavafx.visualjavafxgui.editor.visual.widgets.factory;

import org.netbeans.api.visual.widget.Scene;
import org.netbeans.api.visual.widget.Widget;
import pl.edu.amu.wmi.kino.visualjavafx.model.objects.Frame;
import pl.edu.amu.wmi.kino.visualjavafx.visualjavafxgui.editor.visual.widgets.CanvasWidget;
import pl.edu.amu.wmi.kino.visualjavafx.visualjavafxgui.editor.visual.widgets.factory.api.WidgetFactory;

/**
 *
 * @author psychollek
 */
public class CanvasWidgetFactory implements WidgetFactory{

    @Override
    public boolean canGenerateFrom(Object t) {
        if(t instanceof Frame){
            return true;
        }
        return false;
    }

    @Override
    public Widget generate(Scene s, Object t) {
        Frame f = (Frame) t;
        return new CanvasWidget(s,f,f.getCanvas());
    }

}
